package models;

import com.et.ar.ActiveRecordBase;
import com.et.ar.annotations.BelongsTo;
import com.et.ar.annotations.Column;
import com.et.ar.annotations.Id;
import com.et.ar.annotations.Table;
import com.et.ar.annotations.Unique;

import java.sql.*;


@Table(name="replys")
public class Reply extends ActiveRecordBase{
	@Id private Integer id;
	@Column private String local_id;
	@Column private Integer score;
	@Column private String clientname;
	@Column private String clientemail;
	@Column private String clientphone;
	@Column private String clientmsg;
	@Column private Timestamp replydate;
	@Column private Integer passflag;
	@Column private Integer toweb;


	//	@BelongsTo(foreignKey="demoId")
	//	private Demo demo;

	//	public Demo getDemo() {
	//		return demo;
	//	}
	//	public void setDemo(Demo demo) {
	//		this.demo = demo;
	//	}

	//	public int getChildCount() throws Exception {
	//		return (int)count(Reply.class, "parentId=?", new Object[]{id});
	//	}
	//	public String findChildIds() throws Exception {
	//		String s = "";
	//		List<Integer> ids = new ArrayList<Integer>();
	//		ids.add(id);
	//		while(!ids.isEmpty()){
	//			int id = ids.remove(0);
	//			s += id + ",";
	//			for(Reply item: Reply.findAll(Reply.class, "parentId=?", new Object[]{id})){
	//				ids.add(item.getId());
	//			}
	//		}
	//		if (!s.equals("")){
	//			s = s.substring(0, s.length() - 1);
	//		}
	//		return s;
	//	}
	public void setId(Integer id){
		this.id=id;
	}
	public Integer getId(){
		return id;
	}

	public void setLocal_id(String local_id){
		this.local_id=local_id;
	}
	public String getLocal_id(){
		return local_id;
	}

	public void setScore(Integer score){
		this.score=score;
	}
	public Integer getScore(){
		return score;
	}

	public void setClientname(String clientname){
		this.clientname=clientname;
	}
	public String getClientname(){
		return clientname;
	}

	public void setClientemail(String clientemail){
		this.clientemail=clientemail;
	}
	public String getClientemail(){
		return clientemail;
	}

	public void setClientphone(String clientphone){
		this.clientphone=clientphone;
	}
	public String getClientphone(){
		return clientphone;
	}

	public void setClientmsg(String clientmsg){
		this.clientmsg=clientmsg;
	}
	public String getClientmsg(){
		return clientmsg;
	}

	public void setReplydate(Timestamp replydate){
		this.replydate=replydate;
	}
	public Timestamp getReplydate(){
		return replydate;
	}

	public void setPassflag(Integer passflag){
		this.passflag=passflag;
	}
	public Integer getPassflag(){
		return passflag;
	}

	public void setToweb(Integer toweb){
		this.toweb=toweb;
	}
	public Integer getToweb(){
		return toweb;
	}

}

